package cn.com.oil.service.impl;

import cn.com.oil.common.result.Result;
import cn.com.oil.common.util.FileUtils;
import cn.com.oil.common.util.FxManager;
import cn.com.oil.service.ProjectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class ProjectServiceImpl implements ProjectService {


    @Override
    public Result<String> createProject(String name) {

        String initWindowsName = FileUtils.getCacheJSon().get("initWindowsName", String.class);
        if (FxManager.hasFx(initWindowsName)) {
            FxManager.changeFx(initWindowsName, name);
        } else {
            FxManager.addFx(name);
        }
        return Result.success("success");
    }
}
